<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/position',
    'namespace' => 'Frieza\\Modules\\Position\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    \Biz\service\admin\tools\SimpleRouteTpl::getInstance('/tpl', 'BizPositionController')->routes($router);
    //APP固定资源位
    $router->get('/index', 'IndexController@main')->name('position.main');
    $router->put('/index/{id}', 'IndexController@relSave')->name('position.relSave');
    $router->any('/index/clearPositionCache', 'IndexController@clearPositionCache')->name('positionManage.clearCache');
    $router->post('/sort', 'IndexController@sort')->name('position.sort');
    $router->get('/area', 'IndexController@area')->name('position.area');
    $router->get('/area4name', 'IndexController@area4name')->name('position.area4name');
    //资源位白名单
    $router->get('/index/whitelist', 'IndexController@whitelist')->name('position.whitelist');
    $router->delete('/index/whitelist/{id}', 'IndexController@whitelistDel')->name('position.whitelistDel');
    $router->get('/index/whitelist/create', 'IndexController@whitelistCreate')->name('position.whitelistCreate');
    $router->post('/index/whitelist/create', 'IndexController@whitelistSave')->name('position.whitelistSave');


    //占位后台配置列表
    $router->any('/adType/index', 'UserProfileController@adType');
    $router->any('/adType/sort', 'UserProfileController@adTypeSort');
    $router->delete('/adType/index/{id}', 'UserProfileController@adTypeDel');
    $router->put('/adType/index/{id}', 'UserProfileController@adTypeModify');

    //清除资源位缓存
    $router->post('/userProfile/delPosition', 'UserProfileController@delPosition')->name('position.delPosition');
    $router->post('/admIndex/api', 'IndexController@api')->name('position.api');

    //自定义分群
    $router->post('/userProfile/sort', 'UserProfileController@customSort')->name('position.customSort');
    $router->get('/userProfile/custom', 'UserProfileController@custom')->name('position.customList');
    $router->get('/userProfile/custom/create', 'UserProfileController@customCreate')->name('position.customCreate');
    $router->get('/userProfile/custom/{id}/edit', 'UserProfileController@customCreate')->name('position.customCreate');
    $router->post('/userProfile/custom/create', 'UserProfileController@customSave')->name('position.customSave');
    $router->delete('/userProfile/custom/{id}', 'UserProfileController@customDel')->name('position.customDel');


    \Doraemon\service\position\PositionRoute::adminRoute($router);

    //用户分群后台
    $router->get('/userProfile/list', 'UserProfileListController@index')->name('userPosition.list');
    $router->get('/userProfile/exportData', 'UserProfileListController@exportData')->name('userPosition.exportData');

    //昵称修改记录
    $router->get('/historyNick/index', 'HistoryNickController@index');

    //词包查询
    $router->any('/queryWords/index', 'QueryWordsController@index');
    $router->get('/queryWords/export', 'QueryWordsController@export');

});
